import { useSelector } from "react-redux"
import { StateType } from "../store"
import { UserStateType } from "../store/userReducer"

function useGetUserInfo() {
    // state.user就是一个对象 {username:...,nickname:...}
    const { username, nickname } = useSelector<StateType>(state => state.user) as UserStateType
    return { username, nickname }
}

export default useGetUserInfo
